import Vue from 'vue';
import Router from '../vue-router';
import Index from '../views/index.vue';
// import Cuvee from '../components/Cuvee.vue';
// import Seed from '../components/Seed.vue';
Vue.use(Router);
const router = new Router({
  routes: [
    {
      path: '/',
      name: 'Index',
      component: Index,
      // children: [
      //   {
      //     path: '/cuvee',
      //     name: 'Cuvee',
      //     // 子路由不能使用懒加载
      //     component: Cuvee,
      //   },
      //   {
      //     path: '/seed',
      //     name: 'Seed',
      //     component: Seed,
      //   },
      // ],
    },
    {
      path: '/about',
      name: 'About',
      component: () =>
        import(/* webpackChunkName: 'about' */ '../views/about.vue'),
    },
    {
      path: '/detail/:id',
      name: 'Detail',
      component: () =>
        import(/* webpackChunkName: 'detail' */ '../views/detail.vue'),
    },
  ],
});

/**
 * 编程式导航
 * $router.go()    跳转相对当前的第几个目录
 * $router.replace() 不产生记录
 * $router.push() 往记录后面添加一个记录
 */
export default router;
